import socket
import time
port = 8080
host = 'localhost'

#建立socket对象
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

#进行连接
s.connect((host, port))

s.send('hello'.encode('utf-8'))
#根据特性，将其休眠，可能不在粘包
time.sleep(5)
s.send('world'.encode('utf-8'))

